package com.guojian.jdbc.sql;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.SingleColumnRowMapper;

public class SqlConfig<T> {

	private RowMapper<T> rowMapper;

	public static <T> SqlConfig<T> create(Class<T> c) {
		return new SqlConfig<T>();
	}

	public SqlConfig<T> setRowMapper(RowMapper<T> rowMapper) {
		this.rowMapper = rowMapper;
		return this;
	}

	public RowMapper<T> getRowMapper() {
		return rowMapper;
	}

	public static void main(String[] args) {
		SqlConfig<Integer> sqlconfig = SqlConfig.create(Integer.class).setRowMapper(new SingleColumnRowMapper<Integer>());
		RowMapper<Integer> mapper = sqlconfig.getRowMapper();
		System.out.println(mapper);
	}

}
